HAWKENGINE_DIR=hawkengine
MYDIR=$(shell pwd)

cleanlinks:
	@echo "removing old links"
	@rm -f $(MYDIR)/$(HAWKENGINE_DIR)/build/app
	@rm -f $(MYDIR)/$(HAWKENGINE_DIR)/include/app
	@rm -f $(MYDIR)/$(HAWKENGINE_DIR)/src/app
	@rm -f $(MYDIR)/$(HAWKENGINE_DIR)/data/app

addlinks: cleanlinks
	@echo "adding new links"
	@ln -sf $(MYDIR)/build $(MYDIR)/$(HAWKENGINE_DIR)/build/app
	@ln -sf $(MYDIR)/include $(MYDIR)/$(HAWKENGINE_DIR)/include/app
	@ln -sf $(MYDIR)/src $(MYDIR)/$(HAWKENGINE_DIR)/src/app
	@ln -sf $(MYDIR)/data $(MYDIR)/$(HAWKENGINE_DIR)/data/app

hawkengine.%: force
	cd $(HAWKENGINE_DIR) && make $*

%: addlinks hawkengine.% cleanlinks force ;

force: ;

